//
//  ZYXSystemHeader.h
//  ZYXApp
//
//  Created by 梁炜东 on 2017/4/1.
//  Copyright © 2017年 梁炜东. All rights reserved.
//

#ifndef ZYXSystemHeader_h
#define ZYXSystemHeader_h


#define IS_IOS_8 (NSFoundationVersionNumber>=NSFoundationVersionNumber_iOS_8_0? YES : NO)
#define IS_IOS_9 (NSFoundationVersionNumber>=NSFoundationVersionNumber_iOS_9_0? YES : NO)
#define IS_IOS_10 (NSFoundationVersionNumber>=NSFoundationVersionNumber_iOS_9_x_Max? YES : NO)
#define IS_IOS_11 @available(iOS 11.0, *)

#define IS_IPHONE4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
#define IS_IPHONE5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define IS_IPHONE6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) || CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size)) : NO)
#define IS_IPHONE6PLUS ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (CGSizeEqualToSize(CGSizeMake(1125, 2001), [[UIScreen mainScreen] currentMode].size) || CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size)) : NO)

#define IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)


//调试阶段用DLog打印日志，并且必要的日志可以不用删除
//DEBUG  模式下打印日志,当前行
#ifdef DEBUG
#define NSLog(format, ...) do {                                                             \
fprintf(stderr, "<%s : %d> %s\n",                                           \
[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],  \
__LINE__, __func__);                                                        \
(NSLog)((format), ##__VA_ARGS__);                                           \
fprintf(stderr, "-------\n");                                               \
} while (0)
#else
#define NSLog(...)
#endif

#endif /* ZYXSystemHeader_h */
